import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import MaterialInfo from "../views/nav/MaterialInfo";
import UserInfo from "../views/nav/UserInfo";
import About from "../views/nav/About";
import Login from "../views/Login";
import SnapShot from "../views/nav/SnapShot";
import Excipients from "../views/nav/Excipients";
import Documents from "../views/nav/Documents";
import TableView from "../views/TableView";

// 原料
import tableShapeDesc from "../components/table-shape-desc"
import nutritionTable from "../components/nutrition-table"
import ingredientTable from "../components/ingredient-table"
import ingredientCheckTable from "../components/ingredient-check-table"
import productMaintainTable from "../components/product-maintain-table"


// 辅料
import packMaintain from "../components/pack-maintain-table"

// 文档
import learningDocTable from "../components/learning-doc-table"
import researchDocTable from "../components/research-doc-table"

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    children: [
      /* 两者是平行的关系 */
      {
        path: 'material',
        component: MaterialInfo,  // 总览
      },
      {
        path: 'excipients',
        component: Excipients,  // 总览
      },
      // {
      //   path: '/table/shapeDesc',
      //   component: tableShapeDesc,  // 总览
      // },
      {
        path: '/table',
        name: 'table',
        component: TableView,
        children: [
          {
            path: "shapeDesc",
            component: tableShapeDesc
          }, {
            path: "nutrition",
            component: nutritionTable
          }, {
            path: "ingredient",
            component: ingredientTable
          }, {
            path: "ingredient_check",
            component: ingredientCheckTable
          }, {
            path: "product_maintain",
            component: productMaintainTable
          }, {
            path: "pack_maintain",
            component: packMaintain
          }

        ]

      },
      {
        path: "/doc",
        name: "Doc",
        component: Documents,
        children: [{
          path: 'note',
          component: learningDocTable,
        }, {
          path: 'report',
          component: researchDocTable

           // , {
            //   name: '辣椒科研表',
            //   value: 'chili_research',
            // }, {
            //   name: '花椒科研表',
            //   value: 'flower_chili_research',
            // },


        }]
      },
      {
        path: '/userInfo',
        component: UserInfo
      },
      {
        path: '/snapshot',
        component: SnapShot
      },

      {
        path: '/about',
        component: About
      },

    ]
  },

  {
    path: "/login",
    name: "Login",
    component: Login,
  },



];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
